```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reactive Streams与JUC高性能编程指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
            margin-top: 1.5em;
            margin-bottom: 0.8em;
        }
        .hero {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }
        .card {
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        }
        .code-block {
            background-color: #2d3748;
            color: #e2e8f0;
            border-radius: 0.375rem;
        }
        .table-compare {
            border-collapse: separate;
            border-spacing: 0;
            border-radius: 0.5rem;
            overflow: hidden;
        }
        .table-compare th, .table-compare td {
            padding: 1rem;
            text-align: left;
        }
        .table-compare tr:nth-child(even) {
            background-color: #f7fafc;
        }
        .table-compare tr:hover {
            background-color: #ebf8ff;
        }
        .concept-icon {
            font-size: 2rem;
            color: #667eea;
            margin-bottom: 1rem;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-6">Reactive Streams & JUC</h1>
            <h2 class="text-2xl md:text-3xl font-medium mb-8">构建高性能Java应用的艺术</h2>
            <p class="text-xl max-w-3xl mx-auto opacity-90 mb-10">在现代高并发、高吞吐量的系统中，传统同步阻塞模型已无法满足需求。探索如何通过Reactive Streams和JUC构建高性能、高可扩展的应用系统。</p>
            <div class="flex justify-center space-x-4">
                <a href="#intro" class="bg-white text-indigo-700 px-6 py-3 rounded-full font-medium hover:bg-gray-100 transition duration-300">
                    <i class="fas fa-book-open mr-2"></i>开始阅读
                </a>
                <a href="#code" class="bg-indigo-800 text-white px-6 py-3 rounded-full font-medium hover:bg-indigo-700 transition duration-300">
                    <i class="fas fa-code mr-2"></i>查看代码
                </a>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <div class="container mx-auto max-w-5xl px-4 py-12">
        <!-- Introduction -->
        <section id="intro" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-indigo-500 flex-1"></div>
                <h2 class="text-3xl font-bold px-4">为什么需要Reactive Streams？</h2>
                <div class="h-1 bg-indigo-500 flex-1"></div>
            </div>
            <div class="text-lg leading-relaxed">
                <p class="mb-6">在现代高并发、高吞吐量的系统中，传统的同步阻塞模型已经无法满足需求。想象一下，你的系统需要处理数百万的并发请求，每个请求都可能涉及多个I/O操作（如数据库查询、远程服务调用等）。如果使用传统的同步模型，线程资源很快就会被耗尽，系统性能急剧下降。</p>
                <p class="font-medium text-indigo-700 mb-6"><strong>Reactive Streams</strong> 提供了一种全新的编程范式，通过异步非阻塞的方式，显著提升系统的吞吐量和响应速度。结合 <strong>JUC（Java Util Concurrent）</strong>，我们可以构建出高性能、高可扩展的应用系统。</p>
            </div>
        </section>

        <!-- Reactive Streams Basics -->
        <section id="basics" class="mb-20">
            <h2 class="text-3xl font-bold mb-8 border-l-4 border-indigo-500 pl-4">Reactive Streams基础</h2>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div class="card bg-white p-6 rounded-lg">
                    <div class="concept-icon text-center">
                        <i class="fas fa-project-diagram"></i>
                    </div>
                    <h3 class="text-2xl font-semibold mb-4 text-center">什么是Reactive Streams？</h3>
                    <p class="mb-4">Reactive Streams 是一种异步流处理规范，旨在解决背压（Backpressure）问题。它定义了四个核心接口：</p>
                    <ul class="space-y-2 pl-5">
                        <li class="flex items-start">
                            <i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>Publisher</strong>：数据发布者</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>Subscriber</strong>：数据订阅者</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>Subscription</strong>：订阅关系</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>Processor</strong>：既是Publisher又是Subscriber</span>
                        </li>
                    </ul>
                </div>
                
                <div class="card bg-white p-6 rounded-lg">
                    <div class="concept-icon text-center">
                        <i class="fas fa-lightbulb"></i>
                    </div>
                    <h3 class="text-2xl font-semibold mb-4 text-center">核心概念</h3>
                    <ul class="space-y-3">
                        <li class="flex items-start">
                            <div class="bg-indigo-100 text-indigo-700 rounded-full p-2 mr-3">
                                <i class="fas fa-bolt"></i>
                            </div>
                            <div>
                                <strong>异步非阻塞</strong>：不阻塞调用线程，提高资源利用率
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="bg-indigo-100 text-indigo-700 rounded-full p-2 mr-3">
                                <i class="fas fa-compress-alt"></i>
                            </div>
                            <div>
                                <strong>背压控制</strong>：订阅者可以控制数据流的速度，避免生产者压垮消费者
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="bg-indigo-100 text-indigo-700 rounded-full p-2 mr-3">
                                <i class="fas fa-stream"></i>
                            </div>
                            <div>
                                <strong>流式处理</strong>：数据以流的形式处理，支持丰富的操作符（如map、filter、flatMap等）
                            </div>
                        </li>
                    </ul>
                </div>
            </div>

            <h3 class="text-2xl font-semibold mb-6">Reactive Streams vs 传统同步模型</h3>
            <div class="overflow-x-auto">
                <table class="table-compare w-full bg-white rounded-lg shadow-sm mb-8">
                    <thead class="bg-indigo-600 text-white">
                        <tr>
                            <th class="py-3 px-4 text-left">特性</th>
                            <th class="py-3 px-4 text-left">传统同步模型</th>
                            <th class="py-3 px-4 text-left">Reactive Streams</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="py-3 px-4 font-medium">线程模型</td>
                            <td class="py-3 px-4">阻塞</td>
                            <td class="py-3 px-4">非阻塞</td>
                        </tr>
                        <tr>
                            <td class="py-3 px-4 font-medium">资源利用率</td>
                            <td class="py-3 px-4">低</td>
                            <td class="py-3 px-4">高</td>
                        </tr>
                        <tr>
                            <td class="py-3 px-4 font-medium">背压支持</td>
                            <td class="py-3 px-4">无</td>
                            <td class="py-3 px-4">有</td>
                        </tr>
                        <tr>
                            <td class="py-3 px-4 font-medium">适用场景</td>
                            <td class="py-3 px-4">低并发</td>
                            <td class="py-3 px-4">高并发</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </section>

        <!-- JUC Section -->
        <section id="juc" class="mb-20">
            <h2 class="text-3xl font-bold mb-8 border-l-4 border-indigo-500 pl-4">JUC：并发编程的基石</h2>
            
            <div class="grid md:grid-cols-3 gap-6 mb-8">
                <div class="card bg-white p-6 rounded-lg">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-700"><i class="fas fa-tasks mr-2"></i>线程池优化</h3>
                    <ul class="space-y-2 pl-5">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>FixedThreadPool</strong>：固定大小线程池</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>CachedThreadPool</strong>：弹性线程池</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>ForkJoinPool</strong>：分治任务线程池</span>
                        </li>
                    </ul>
                </div>
                
                <div class="card bg-white p-6 rounded-lg">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-700"><i class="fas fa-boxes mr-2"></i>并发集合</h3>
                    <ul class="space-y-2 pl-5">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>ConcurrentHashMap</strong>：高并发Map</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>CopyOnWriteArrayList</strong>：读多写少List</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>BlockingQueue</strong>：阻塞队列（如ArrayBlockingQueue、LinkedBlockingQueue）</span>
                        </li>
                    </ul>
                </div>
                
                <div class="card bg-white p-6 rounded-lg">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-700"><i class="fas fa-atom mr-2"></i>原子变量与CAS</h3>
                    <ul class="space-y-2 pl-5">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>AtomicInteger</strong>：原子整型</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>AtomicReference</strong>：原子引用</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span><strong>LongAdder</strong>：高性能计数器</span>
                        </li>
                    </ul>
                </div>
            </div>
        </section>

        <!-- Integration Section -->
        <section id="integration" class="mb-20">
            <h2 class="text-3xl font-bold mb-8 border-l-4 border-indigo-500 pl-4">Reactive Streams与JUC的结合</h2>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div>
                    <h3 class="text-2xl font-semibold mb-4">异步任务调度</h3>
                    <p class="mb-4">通过JUC的线程池，我们可以高效地调度Reactive Streams中的异步任务。</p>
                    <div id="code" class="code-block p-4 rounded-lg mb-6">
                        <pre class="text-sm md:text-base"><code class="language-java">Scheduler scheduler = Schedulers.from(Executors.newFixedThreadPool(10));

Flux.range(1, 100)
    .parallel()
    .runOn(scheduler)
    .map(i -> intensiveComputation(i))
    .sequential()
    .subscribe(System.out::println);</code></pre>
                    </div>
                </div>
                
                <div>
                    <h3 class="text-2xl font-semibold mb-4">背压控制</h3>
                    <p class="mb-4">Reactive Streams通过Subscription机制实现背压控制，JUC的BlockingQueue可以作为缓冲区。</p>
                    <div class="code-block p-4 rounded-lg mb-6">
                        <pre class="text-sm md:text-base"><code class="language-java">Flux.range(1, 1000)
    .onBackpressureBuffer(100, BufferOverflowStrategy.DROP_LATEST)
    .subscribe(new Subscriber&lt;Integer&gt;() {
        private Subscription subscription;

        @Override
        public void onSubscribe(Subscription s) {
            this.subscription = s;
            s.request(10); // 初始请求10个元素
        }

        @Override
        public void onNext(Integer integer) {
            process(integer);
            subscription.request(1); // 处理完一个再请求下一个
        }

        @Override
        public void onError(Throwable t) {
            t.printStackTrace();
        }

        @Override
        public void onComplete() {
            System.out.println("Done");
        }
    });</code></pre>
                    </div>
                </div>
            </div>
            
            <div class="mb-8">
                <h3 class="text-2xl font-semibold mb-4">高性能数据处理</h3>
                <p class="mb-4">结合JUC的并发集合，我们可以实现高效的数据处理流水线。</p>
                <div class="code-block p-4 rounded-lg">
                    <pre class="text-sm md:text-base"><code class="language-java">Flux.range(1, 1000)
    .parallel()
    .runOn(Schedulers.parallel())
    .map(i -> transform(i))
    .sequential()
    .collect(Collectors.toConcurrentMap(i -> i, i -> i * 2))
    .subscribe(System.out::println);</code></pre>
                </div>
            </div>
        </section>

        <!-- Case Study -->
        <section id="case-study" class="mb-20">
            <h2 class="text-3xl font-bold mb-8 border-l-4 border-indigo-500 pl-4">实战案例：高性能订单处理系统</h2>
            
            <div class="bg-white rounded-lg shadow-sm p-6 mb-8">
                <h3 class="text-2xl font-semibold mb-4 text-indigo-700">需求分析</h3>
                <p class="mb-6">我们需要处理来自多个渠道的订单，每个订单需要经过以下步骤：</p>
                <ol class="list-decimal pl-5 space-y-2">
                    <li><strong>验证订单</strong>：检查订单合法性</li>
                    <li><strong>计算价格</strong>：调用价格服务</li>
                    <li><strong>库存扣减</strong>：调用库存服务</li>
                    <li><strong>生成日志</strong>：记录操作日志</li>
                </ol>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div>
                    <h3 class="text-2xl font-semibold mb-4">系统设计</h3>
                    <ul class="space-y-3 pl-5">
                        <li class="flex items-start">
                            <div class="bg-indigo-100 text-indigo-700 rounded-full p-2 mr-3">
                                <i class="fas fa-inbox"></i>
                            </div>
                            <div>
                                <strong>订单接收</strong>：使用Reactive Streams处理高并发订单流
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="bg-indigo-100 text-indigo-700 rounded-full p-2 mr-3">
                                <i class="fas fa-tasks"></i>
                            </div>
                            <div>
                                <strong>异步处理</strong>：使用JUC线程池调度任务
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="bg-indigo-100 text-indigo-700 rounded-full p-2 mr-3">
                                <i class="fas fa-tachometer-alt"></i>
                            </div>
                            <div>
                                <strong>背压控制</strong>：防止系统过载
                            </div>
                        </li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-2xl font-semibold mb-4">性能优化点</h3>
                    <ul class="space-y-3 pl-5">
                        <li class="flex items-start">
                            <div class="bg-indigo-100 text-indigo-700 rounded-full p-2 mr-3">
                                <i class="fas fa-sliders-h"></i>
                            </div>
                            <div>
                                <strong>线程池调优</strong>：根据任务类型调整线程池大小
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="bg-indigo-100 text-indigo-700 rounded-full p-2 mr-3">
                                <i class="fas fa-database"></i>
                            </div>
                            <div>
                                <strong>缓存优化</strong>：使用Caffeine缓存价格计算结果
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="bg-indigo-100 text-indigo-700 rounded-full p-2 mr-3">
                                <i class="fas fa-boxes"></i>
                            </div>
                            <div>
                                <strong>批量处理</strong>：合并库存扣减请求，减少远程调用次数
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            
            <h3 class="text-2xl font-semibold mb-4">核心代码实现</h3>
            <div class="code-block p-4 rounded-lg mb-8">
                <pre class="text-sm md:text-base"><code class="language-java">public class OrderProcessor {
    private final ExecutorService executor = Executors.newFixedThreadPool(10);

    public Flux&lt;OrderResult&gt; processOrders(Flux&lt;Order&gt; orders) {
        return orders
            .parallel()
            .runOn(Schedulers.fromExecutor(executor))
            .flatMap(this::validateOrder)
            .flatMap(this::calculatePrice)
            .flatMap(this::deductStock)
            .flatMap(this::generateLog)
            .sequential();
    }

    private Mono&lt;OrderResult&gt; validateOrder(Order order) {
        return Mono.fromCallable(() -> validationService.validate(order))
                  .subscribeOn(Schedulers.boundedElastic());
    }

    private Mono&lt;OrderResult&gt; calculatePrice(Order order) {
        return Mono.fromCallable(() -> priceService.calculate(order))
                  .subscribeOn(Schedulers.boundedElastic());
    }

    private Mono&lt;OrderResult&gt; deductStock(Order order) {
        return Mono.fromCallable(() -> stockService.deduct(order))
                  .subscribeOn(Schedulers.boundedElastic());
    }

    private Mono&lt;OrderResult&gt; generateLog(Order order) {
        return Mono.fromRunnable(() -> logService.log(order))
                  .subscribeOn(Schedulers.boundedElastic())
                  .thenReturn(new OrderResult(order, "SUCCESS"));
    }
}</code></pre>
            </div>
        </section>

        <!-- Performance Comparison -->
        <section id="performance" class="mb-20">
            <h2 class="text-3xl font-bold mb-8 border-l-4 border-indigo-500 pl-4">性能对比：传统同步 vs Reactive Streams + JUC</h2>
            <div class="bg-white rounded-lg shadow-sm p-6 overflow-x-auto">
                <table class="table-compare w-full">
                    <thead class="bg-indigo-600 text-white">
                        <tr>
                            <th class="py-3 px-4 text-left">指标</th>
                            <th class="py-3 px-4 text-left">传统同步模型</th>
                            <th class="py-3 px-4 text-left">Reactive Streams + JUC</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="py-3 px-4 font-medium">线程数</td>
                            <td class="py-3 px-4">1000</td>
                            <td class="py-3 px-4">16</td>
                        </tr>
                        <tr>
                            <td class="py-3 px-4 font-medium">CPU利用率</td>
                            <td class="py-3 px-4">30%</td>
                            <td class="py-3 px-4">80%</td>
                        </tr>
                        <tr>
                            <td class="py-3 px-4 font-medium">内存占用</td>
                            <td class="py-3 px-4">高</td>
                            <td class="py-3 px-4">低</td>
                        </tr>
                        <tr>
                            <td class="py-3 px-4 font-medium">最大QPS</td>
                            <td class="py-3 px-4">1200</td>
                            <td class="py-3 px-4">9800</td>
                        </tr>
                        <tr>
                            <td class="py-3 px-4 font-medium">平均响应时间</td>
                            <td class="py-3 px-4">150ms</td>
                            <td class="py-3 px-4">20ms</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </section>

        <!-- Advanced Topics -->
        <section id="advanced" class="mb-20">
            <h2 class="text-3xl font-bold mb-8 border-l-4 border-indigo-500 pl-4">进阶话题：Reactor模式与Netty</h2>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white p-6 rounded-lg shadow-sm">
                    <h3 class="text-2xl font-semibold mb-4 text-indigo-700">Reactor模式</h3>
                    <ul class="space-y-4">
                        <li>
                            <h4 class="font-medium mb-2">单Reactor单线程</h4>
                            <p>简单但性能有限，适合并发量不大的场景</p>
                        </li>
                        <li>
                            <h4 class="font-medium mb-2">单Reactor多线程</h4>
                            <p>业务逻辑异步处理，提高吞吐量</p>
                        </li>
                        <li>
                            <h4 class="font-medium mb-2">主从Reactor多线程</h4>
                            <p>Netty采用的设计，进一步提高并发处理能力</p>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white p-6 rounded-lg shadow-sm">
                    <h3 class="text-2xl font-semibold mb-4 text-indigo-700">Netty框架</h3>
                    <div class="mb-4">
                        <h4 class="font-medium mb-2">核心组件</h4>
                        <ul class="space-y-1 pl-5">
                            <li><i class="fas fa-arrow-right text-indigo-500 mr-2"></i><strong>Channel</strong>：网络操作抽象</li>
                            <li><i class="fas fa-arrow-right text-indigo-500 mr-2"></i><strong>EventLoop</strong>：事件循环</li>
                            <li><i class="fas fa-arrow-right text-indigo-500 mr-2"></i><strong>ChannelPipeline</strong>：处理器链</li>
                        </ul>
                    </div>
                    <div>
                        <h4 class="font-medium mb-2">优势</h4>
                        <ul class="space-y-1 pl-5">
                            <li><i class="fas fa-check-circle text-indigo-500 mr-2"></i><strong>高性能</strong>：基于NIO和零拷贝</li>
                            <li><i class="fas fa-check-circle text-indigo-500 mr-2"></i><strong>易用性</strong>：丰富的编解码器和处理器</li>
                            <li><i class="fas fa-check-circle text-indigo-500 mr-2"></i><strong>扩展性</strong>：支持自定义协议</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- Best Practices -->
        <section id="best-practices" class="mb-20">
            <h2 class="text-3xl font-bold mb-8 border-l-4 border-indigo-500 pl-4">最佳实践与避坑指南</h2>
            
            <div class="grid md:grid-cols-3 gap-6">
                <div class="card bg-white p-6 rounded-lg">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-700"><i class="fas fa-stream mr-2"></i>Reactive Streams最佳实践</h3>
                    <ol class="list-decimal pl-5 space-y-2">
                        <li><strong>合理设置缓冲区大小</strong>：避免内存溢出</li>
                        <li><strong>使用合适的调度器</strong>：根据任务类型选择Scheduler</li>
                        <li><strong>处理错误流</strong>：使用onErrorResume、onErrorReturn等操作符</li>
                    </ol>
                </div>
                
                <div class="card bg-white p-6 rounded-lg">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-700"><i class="fas fa-cogs mr-2"></i>JUC最佳实践</h3>
                    <ol class="list-decimal pl-5 space-y-2">
                        <li><strong>选择合适的线程池</strong>：根据任务类型调整参数</li>
                        <li><strong>避免锁竞争</strong>：使用无锁数据结构</li>
                        <li><strong>监控线程状态</strong>：使用JMX或Micrometer</li>
                    </ol>
                </div>
                
                <div class="card bg-white p-6 rounded-lg">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-700"><i class="fas fa-exclamation-triangle mr-2"></i>常见陷阱</h3>
                    <ul class="space-y-2 pl-5">
                        <li class="flex items-start">
                            <i class="fas fa-times-circle text-red-500 mt-1 mr-2"></i>
                            <span><strong>回调地狱</strong>：过度嵌套回调降低可读性</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-times-circle text-red-500 mt-1 mr-2"></i>
                            <span><strong>线程泄漏</strong>：未正确关闭线程池</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-times-circle text-red-500 mt-1 mr-2"></i>
                            <span><strong>背压失控</strong>：未正确处理背压导致系统崩溃</span>
                        </li>
                    </ul>
                </div>
            </div>
        </section>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8">
        <div class="container mx-auto max-w-5xl px-4 text-center">
            <div class="mb-4">
                <h3 class="text-xl font-medium text-white mb-2">技术小馆</h3>
                <a href="http://www.yuque.com/jtostring" class="text-indigo-400 hover:text-indigo-300 transition duration-300">
                    <i class="fas fa-external-link-alt mr-1"></i>http://www.yuque.com/jtostring
                </a>
            </div>
            <p class="text-sm">© 2023 技术小馆. 保留所有权利.</p>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```